import '../util.dart';

class VersionModel {
  String versionName;
  String uploadTime;
  String content;
  String androidUrl;
  String iosUrl;
  int status;
  int buildNum;
  int updateStatus;
  int isApply;
  VersionModel({
    required this.status,
    required this.versionName,
    required this.uploadTime,
    required this.content,
    required this.androidUrl,
    required this.iosUrl,
    required this.buildNum,
    required this.updateStatus,
    required this.isApply,
  });

  factory VersionModel.fromJson(Map<String, dynamic> json) => VersionModel(
        versionName: json['versionName'].toString(),
        uploadTime: json['uploadTime'].toString(),
        content: json['modifyContent'].toString(),
        androidUrl: json['androidUrl'].toString(),
        iosUrl: json['iosUrl'].toString(),
        status: numVal(json['status']).toInt(),
        buildNum: numVal(json['buildNum']).toInt(),
        updateStatus: numVal(json['updateStatus']).toInt(),
        isApply: numVal(json['isApply']).toInt(),
      );
}

class VersionResultModel {
  bool isApply;
  bool isUpdate;

  VersionResultModel({
    required this.isApply,
    required this.isUpdate,
  });
}
